package com.yun.algorithmproblem.huaweiod;

import java.util.Scanner;

public class OD344 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] ch = s.toCharArray();
        int res = 0;
        int count = 0;
        int prev = 0;
        for (char c : ch) {
            if (c == '0') {
                count++;
            } else {
                if (prev == 0) {
                    res += count / 2;
                } else {
                    if (count != 0) {
                        res += (count - 1) / 2;
                    }
                }
                prev = 1;
                count = 0;
            }
        }
        if(prev==0){
            res+=(count+1)/2;
        }else {
            res+=count / 2;
        }
        System.out.println(res);
    }
}
